package autotrace;

import org.opencv.core.Mat;

import android.util.Log;

public class Autotrace
{
	public static native void staticMethod();

	public static native void traceMat(long jdataAddr, int jwidth, int jheight, String jfileName, String jfileExt);

	public static native void traceImage(String inputFileJ, String outputFileJ, String outputFormatJ);

	public static native void helloLog(String logThis);

	public static void traceMatAsync(Mat mat, String jfileName, String jfileExt)
	{
		class AsyncTrace implements Runnable
		{
			public AsyncTrace(Mat mat, String jfileName, String jfileExt)
			{
				super();
				this.mat = mat;
				this.jfileName = jfileName;
				this.jfileExt = jfileExt;
			}

			String	jfileName;
			String	jfileExt;
			Mat		mat;

			public void run()
			{
				traceMat(mat.dataAddr(), mat.width(), mat.height(), jfileName, jfileExt);
			}
		}
		new Thread(new AsyncTrace(mat, jfileName, jfileExt)).start();
	}
}
